package cn.yunhe.services.impl;

import cn.yunhe.dao.IUsersDao;
import cn.yunhe.entity.Users;
import cn.yunhe.services.IUsersServices;
import cn.yunhe.utils.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

public class UsersServices implements IUsersServices {
    SqlSession session= SqlSessionFactoryUtil.getSession();
    IUsersDao iUsersDao=session.getMapper(IUsersDao.class);

    @Override
    public int userRegister(Users users) {
        int row=iUsersDao.userRegister(users);
        session.commit();
        session.close();
        return row;
    }

    @Override
    public Users userLogin(Users users) {
        return iUsersDao.userLogin(users);
    }

    @Override
    public Users userCheck(Users users) {
        return iUsersDao.userCheck(users);
    }
}
